1. Field of the Invention
The present invention relates generally to calculating RMS values. More particularly, the present invention relates to a technique for computing RMS values for sampled waveforms, in which a number of samples is difficult to predict. The technique permits the computation of accurate values in real time, in a processing routine designed to perform other real time operations as well.
2. Description of the Related Art
A variety of systems, particularly in the industrial control field, require sampling of data and analysis of the data to make decisions based on the measurements. The data and analysis of the data can represent various parameters, such as current, voltage, power and so forth. In a number of applications it is particularly useful to analyze sampled data based on a set of samples to determine a root-mean-squared (RMS) value. The RMS value calculations are useful in condensing a series comprising a plurality of measurements into one useful measurement.
One particular area in which RMS calculations may be useful is in the analysis of waveform data. Particularly, RMS value calculation may be useful in interpreting alternating waveforms (i.e. sine waves of voltage or current) in any electronics based system. Generally, the RMS value of a series of observations equals the square root of the quotient of the sum of the squares divided by the number of samples.
It is often desirable to know the exact RMS content of a signal. This can be accomplished by means of hardware or software-based calculation methods. In a microprocessor controlled system the means for calculating RMS may be particularly computationally inefficient. That is to say that often RMS calculations must be made in the foreground, thereby making the microprocessor unavailable to perform other system functions during the RMS calculations. Disadvantageously, this method of RMS calculation is insufficient for wide frequency range applications or for high frequency applications since the RMS calculations would literally flood the microprocessor with data and require significant calculation time, precluding the microprocessor from performing other necessary operations.
One application which is particularly well suited for variable frequency range applications is motor control. In typical motor applications a microcontroller-based variable frequency motor controller may perform RMS calculations for current or voltage. Other support or protection devices in such applications such as power systems including overload relays use similar calculations for interpreting power in the power conductors to permit protective action or reporting when a fault condition occurs, such as a ground fault, a phase loss, or an overcurrent condition. Typically, these overload relays may only operate on a frequency range from 50 hertz to 60 hertz due to the necessity of the RMS calculations based on a hardware solution. However, there is a need for a method and apparatus for calculating RMS values in motor control and other systems which operates over a wide variable frequency range, and which can make such calculations very efficiently, even as the waveform period changes.
The present invention provides a technique designed to respond to these needs. In accordance with the present technique, an RMS value of a periodic waveform is calculated based upon sampled data of the waveform. Because the waveform period may vary or be unknown, the technique permits for accurate calculation of the RMS value in accordance with one of a plurality of routines, the routine being selected based upon the quantity or quality of the sampled data. The routines thus permit a calculation to be made based upon samples taken during an acquisition cycle, the cycle covering a full waveform, a half waveform, or some other portion of the waveform. Each RMS calculation may be based on a different routine, depending upon the particular criteria set for a selection of the routine and upon the sampling permitted by the waveform period.
The technique is adaptable to a variety of devices for implementation. In particular, the technique is well suited to systems in which RMS calculations are to be made on sampled data in real time. The technique is particularly computationally efficient, such that it may be implemented with other portions of a routine repeated cyclically by a microprocessor or other processing circuit. By way of example, the technique is employed in a relay in which values of current are sampled from conductors and are used to calculate an RMS current value.